# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: nfnty <arch@nfnty.se>

pkgname=shotcut
pkgdesc='Cross-platform Qt based Video Editor'
pkgver=22.12.21
pkgrel=1
arch=('loong64' 'x86_64')
url='https://www.shotcut.org'
license=('GPL3')
depends=('qt5-base' 'qt5-declarative' 'qt5-graphicaleffects' 'qt5-multimedia'
         'qt5-quickcontrols' 'qt5-quickcontrols2' 'qt5-websockets' 'qt5-x11extras'
         'mlt' 'movit' 'ffmpeg' 'libx264' 'libvpx' 'lame' 'frei0r-plugins' 'ladspa')
optdepends=('swh-plugins: Several audio filters')
makedepends=('qt5-tools' 'cmake' 'ninja')
options=('debug')
source=("$pkgname-$pkgver.tar.gz::https://github.com/mltframework/shotcut/archive/v$pkgver.tar.gz")
sha512sums=('95ca399657934becedd71c3daa74749bca1b625a0cedf8df4bfd212476602f83f5b807b26ec7c8275ee720e54893102931bf109c95153fc16f348d344e50395b')

build() {
  cd "${pkgname}-${pkgver}"

  # https://github.com/mltframework/shotcut/issues/1275
  export CXXFLAGS+=" -DSHOTCUT_NOUPGRADE"

  cmake \
    -Bbuild \
    -GNinja \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DSHOTCUT_VERSION=${pkgver}
  cmake --build build --verbose

  ninja -C build translations
}

package() {
  cd "${pkgname}-${pkgver}"
  DESTDIR="${pkgdir}" cmake --install build
}

# vim:set ft=sh sw=2 sts=2 et:
